@import '../toolbox/buttons/css/base.css';
@import '../app/variables.css';

:root {
  --header-margin-right-left-M: 20px;
  --header-margin-top-bottom-M: 23px;
  --header-margin-right-left-S: 20px;
  --header-margin-top-bottom-S: 10px;
  --avatar-height: 69px;
  --avatar-height-s: 33px;
  --menu-icon-height-XL: 39px;
  --menu-icon-height-M: 34px;
  --font-size-normal: 16px;
  --font-size-small: 12px;
}

.wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 138px;
  box-sizing: border-box;
  padding-top: 15px;

  & .noPadding {
    padding: 0px;
  }

  & .searchBar {
    display: inline-block;
    float: left;
    margin-bottom: 30px;
    margin-right: 32px;
  }
}

.unlocked {
  color: var(--color-error);
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: var(--font-size-small);
  line-height: 1.5em; /* stylelint-disable-line */
}

.logoWrapper {
  width: 25%;
}

.logo {
  display: none;
}

.logoutButton {
  padding: 8px;
  margin: 6px 8px;
  height: auto;
  float: right;
}

.lock {
  font-size: 19px;
  height: auto;
  vertical-align: top;
  line-height: 24px !important;
  margin-left: 5px;
}

.primary {
  line-height: 40px;

  @mixin buttonBasics;
  @mixin buttonPrimary;
}

.secondaryBlue {
  line-height: 39px;

  @mixin buttonBasics;
  @mixin buttonSecondary--blue;
}

.material-icons {
  font-size: 24px !important;
}

.login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;

  & > p {
    color: var(--color-black);
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    padding: 0;
  }

  & .link {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 7px;
    height: 23px;
    font-size: 14px;
    font-family: var(--content-font);
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    text-decoration: none;

    & > span:first-child {
      font-size: 21px;
    }

    & > span {
      font-weight: normal;
      margin-left: 5px;
      color: var(--color-grayscale-dark);
    }

    &:hover {
      color: var(--color-primary-standard);

      & > span:first-child {
        color: var(--color-primary-standard);
      }
    }
  }
}

.loginInfo {
  display: flex;
  flex-direction: column;
  height: 86px;
  margin: 3px 4px 0 0;
}

.rightSide {
  display: inline-block;
  width: 32vw; /* stylelint-disable-line */
}

.logout {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  color: var(--color-black);
  background-color: var(--color-white);
  height: 25px;
  width: 26px;
  border-radius: 13.5px;
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  position: absolute;
  top: 44px;
  right: -5px;
  transition: all ease 0.1s;
  box-shadow: var(--normal-shadow);

  &:hover {
    width: 75px;
    color: var(--color-primary-standard);
  }
}

.logoutIcon {
  font-size: 18px;
  margin: 0 4px 0 5px;
}

.logoutInfo {
  display: flex;
  justify-content: flex-end;
}

.account {
  position: relative;
  height: 80px;

  & .avatar {
    display: inline-block;
    vertical-align: middle;
    height: var(--avatar-height);
    width: var(--avatar-height);
    margin-right: 30px;
    transition: transform ease-in-out 500ms;

    &:hover {
      transform: scale(1.1);
      transform-origin: 50%;
    }
  }

  & .information {
    display: inline-block;
    line-height: 25px;
    padding-right: 20px;
    height: var(--avatar-height);
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    vertical-align: top;

    & .balance {
      font-size: 24px;
      font-family: var(--heading-font);
      color: var(--color-black);
      line-height: 0.5em; /* stylelint-disable-line */
      padding-top: 7px;

      & small {
        padding-left: 5px;
        font-size: var(--font-size-small);
      }
    }

    & .address {
      font-size: 14px;
      color: var(--color-grayscale-medium);
    }

    & .copy {
      font-size: 24px;
      padding-right: 5px;
    }

    & .timer {
      display: flex;
      justify-content: flex-end;
      font-size: var(--font-size-small);
      color: var(--color-grayscale-medium);
      line-height: 1.5em; /* stylelint-disable-line */
    }
  }

  & .menu {
    cursor: pointer;

    & .item {
      padding: 0;
    }

    & .link {
      text-decoration: none;
      width: 100%;
      height: 100%;
      line-height: 39px;
      color: rgba(0, 0, 0, 0.87);
      padding: 0;
      text-align: center;
    }

    & .iconCircle {
      position: absolute;
      bottom: -14px;
      right: -24px;
      background: var(--color-white);
      border-radius: 100%;
      height: var(--menu-icon-height-XL);
      width: var(--menu-icon-height-XL);
      box-shadow: 0 12px 12px 0 rgba(0, 0, 0, 0.62);
      text-align: center;

      & .button {
        padding: 2px;
      }
    }
  }
}

@media (--medium-viewport) {
  .logout {
    color: var(--color-grayscale-medium);
  }

  .loginInfo {
    width: 100%;
    float: none;
    margin: 0;

    & > div {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }
  }

  .wrapper {
    margin: 0px;
    box-shadow: 0 2px 4px 0 rgba(60, 80, 104, 0.14), 0 8px 10px 0 rgba(60, 80, 104, 0.1);
    width: 100%;
    position: fixed;
    top: 0;
    background-color: var(--color-white);
    z-index: var(--headerbar-index);
    height: auto;

    & .searchBar {
      width: 100%;
      margin-bottom: 0;
      display: none;
    }
  }

  .logo {
    display: inline-block;
    height: 50px;
    padding: 20px;
  }

  .logoutButton {
    display: none;
  }

  .account {
    margin: 13px 13px 0;
    height: 72px;

    & .avatar {
      margin-right: 0;
    }

    & .information {
      & .balance {
        font-size: 20px;
        color: var(--color-black);
        font-family: var(--heading-font);

        & small {
          font-size: 12px;
        }
      }

      & .address {
        font-size: 12px;
        font-weight: 400;
      }
    }

    & .menu {
      & .iconCircle {
        display: none;
      }
    }
  }

  .login {
    height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    margin-right: 5px;
  }
}

@media (--small-viewport) {
  .wrapper {
    height: auto;
  }

  .account {
    margin: var(--header-margin-top-bottom-S) var(--header-margin-right-left-S) 0px 0px;
    height: auto;
    display: flex;
    padding-bottom: 30px;

    & .avatar {
      margin-top: 4px;
      height: var(--avatar-height-s);
      width: var(--avatar-height-s);
    }

    & .information {
      margin-top: 0;
      height: var(--avatar-height-s);
      line-height: 20px;

      & .balance {
        font-size: 18px;
        font-weight: 300;

        & small {
          font-size: 10px;
        }
      }
    }
  }

  .logo {
    height: 40px;
    padding: 10px 10px 7px 20px;
  }

  .login {
    height: 86px;

    & .link {
      margin: var(--header-margin-top-bottom-S) var(--header-margin-right-left-S) var(--header-margin-top-bottom-S) 0px;
      line-height: 46px;
    }
  }
}

@media (--xSmall-viewport) {
  .logo {
    padding: 10px 0 7px;
  }

  .loginInfo {
    margin: 0;
  }
}
